//*************************************************************************
//
//	Code by Michael Carey
//	for Dr. Ostermann's CS444
//
//	Ohio University 2007
//
//	mc12800@ohio.edu
//
//*************************************************************************
#include <iostream>
#include "wserver.h"

using std::cout;
using std::endl;

int main(int argc, char *argv[]){
	Wserver web;
	int port = 0;

	if(argc < 2){
		web.openSocket();
	} else {
		for(int i = 1; i < argc; i++){
			if(!strncmp(argv[i], "-p", 2)){
				port = atoi(argv[i + 1]);
			}
			if(!strncmp(argv[i], "-d", 2)){
				web.setDebug(true);
			}
			if(!strncmp(argv[i], "-u", 2)){
				web.setUchk(false);
			}
		}				
	}

	web.openSocket(port);
	web.servDetails();
	web.start();
	
	return 0;
}
